package com.wtgroup.demo.common.bean;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
@Accessors(chain = true)
public class MultiTreeNode {
    int value;
    List<MultiTreeNode> nexts;

    public void addNext(MultiTreeNode next) {
        if (nexts == null) {
            nexts = new ArrayList<>();
        }
        nexts.add(next);
    }

    @Override
    public String toString() {
        // return "{value=" + value + ", " + "nexts.size=" + (nexts == null ? 0 : nexts.size()) + "}";
        return value + "";
    }

}